package com.gzp.queue;

import javax.jms.JMSException;
import javax.jms.TextMessage;

import org.springframework.jms.annotation.JmsListener;
import org.springframework.stereotype.Component;

/**
 * 监听队列消息
 * 
 * @author Administrator
 *
 */
@Component
public class QueueConsumer {

	@JmsListener(destination = "${myqueue}", containerFactory = "jmsQueueListenerContainerFactory")
	public void receive(TextMessage textMessage) throws JMSException {
		System.out.println("接收到队列的消息，消息内容为：" + textMessage.getText());
	}
}
